const app = getApp()

Page({
  data: {
    headImg:"/imgs/bg01.jpg" ,
    name:"xurose",
    motto:"一叶一菩提" ,
    title:"问题标题" ,
    from:"分享",
    time:"2018-10-22" ,
    content: "this is the content of question... ",
    reply:[
      {id:1, headImg: "/imgs/myac.png", questionText: "this is answer", from: "分享", name: "xurose", time: "2018-10-11", answerNum: "5" },
    ],
    replyIcon:"/imgs/bg01.jpg",
    questionId:1,
    replyShow:false,
    replyIconShow:true,
  },
  onLoad:function(){
    var that=this;
   
  },
  onShareAppMessage: function () {
    var that = this;
    return {
      title: that.data.title,
      path: '/pages/index/index'
    }
  },
  ReplyIcon:function(){
    // var questionId = this.data.questionId;
    console.log(this)
    this.setData({
      replyIconShow:false,
      replyShow:true,
    })

  },
  InputBlur:function(){
    this.setData({
      replyIconShow: true,
      replyShow: false,
    })
  },
  Input:function(e){
    console.log(e)
    this.setData({
      inputData:e.detail.value,
    })
  },
  Reply:function(){
    // data=;
    console.log(this.data.inputData)
    // 提交回复
    wx.request({
      url: '',
      // data:data,
      method:"post",
      success:function(){
        console.log("回复请求提交成功")
      },
      fail:function(){
        console.log("回复请求提交失败")
      },
    })
  },
})
